<template>
  <div id="dailyMent" v-loading="toloading">
    <div class="dailyTop">
      <span>
        <el-button type="success" @click="dailyFill(0)">填写日报</el-button>
        <!-- <el-button type="warning" @click="dailyFill(1)">明日计划</el-button> -->
        <el-link
          @click="confimHours"
          style="margin-left: 10px; color: #333333"
          v-if="islead == 1"
          type="primary"
        >
          待确认日报
          <span style="color: red">({{ count }})</span>
        </el-link>
      </span>
      <span>
        <el-date-picker
          v-model="startDate"
          @change="changeDate"
          value-format="yyyy-MM-dd"
          type="date"
          placeholder="选择日期"
          :picker-options="pickerOptions"
        ></el-date-picker>
      </span>
      <span>
        <el-select v-model="fid" placeholder="请选择" @change="changeGroup">
          <el-option
            v-for="item in groupsList"
            :key="item.id"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
        <el-input
          placeholder="请输入姓名"
          v-model="keyword"
          style="width: 220px"
          @keydown.enter.native="dailyList"
          clearable
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="dailyList"
          ></el-button>
        </el-input>
      </span>
    </div>
    <!-- 日报列表 -->
    <div
      class="taskList"
      v-for="(item, index) in dataList"
      :key="index"
      v-show="dataList.length != 0"
    >
      <div class="taskTile">
        <div class="class_taskTile_left">
          <i class="el-icon-user-solid" v-if="item.isLeader == 1"></i>
          <h3>{{ item.name }}</h3>
          <span>{{ item.groupName }}</span>
          <span>{{ startDate }}</span>
        </div>
        <div
          style="color: #00b98d; cursor: pointer"
          @click="gotoPerProject(item)"
        >
          查看参与项目>
        </div>
      </div>
      <div class="web">
        <!-- <div class="tody">
          <h3>
            <span>今日计划</span>
            <span @click="
              dataliClick(
                item.userId,
                2,
                startDate,
                item.groupName,
                item.name
              )
            ">查看全部计划>></span>
          </h3>
          <el-table :cell-style="cellStyle" border tooltip-effect="dark" :header-cell-style="{ background: '#F9F9F9' }"
            :data="item.todayPlan">
            <el-table-column prop="projectName" align="center" label="项目名称" :show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="content" align="left" label="工作内容"  width="350"></el-table-column>
          </el-table>
        </div> -->
        <div class="fulfill">
          <h3>
            <span>今日已完成任务</span>
            <span
              @click="
                dataliClick(
                  item.userId,
                  1,
                  startDate,
                  item.groupName,
                  item.name
                )
              "
              >查看全部日报>></span
            >
          </h3>
          <el-table
            :cell-style="cellStyle"
            border
            tooltip-effect="dark"
            :header-cell-style="{ background: '#F9F9F9' }"
            :data="item.todayTask"
          >
            <el-table-column
              prop="projectName"
              align="left"
              label="项目名称"
              width="200"
              :show-overflow-tooltip="true"
            >
            </el-table-column>
            <el-table-column
              prop="time"
              align="left"
              label="工时（天）"
              width="100"
            ></el-table-column>
            <el-table-column
              prop="content"
              align="left"
              label="工作内容"
              :show-overflow-tooltip="false"
            >
            </el-table-column>

            <el-table-column
              prop="achievementList"
              v-if="todayachive[0]"
              :label="todayachive[0].name"
              align="left"
              width="100"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 0">{{
                  scope.row.achievementList[0].value
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="achievementList"
              v-if="todayachive[1]"
              :label="todayachive[1].name"
              align="left"
              width="100"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 1">{{
                  scope.row.achievementList[1].value
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="achievementList"
              v-if="todayachive[2]"
              :label="todayachive[2].name"
              align="left"
              width="100"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 2">{{
                  scope.row.achievementList[2].value
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="achievementList"
              v-if="todayachive[3]"
              :label="todayachive[3].name"
              align="left"
              width="100"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 3">{{
                  scope.row.achievementList[3].value
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="achievementList"
              v-if="todayachive[4]"
              :label="todayachive[4].name"
              align="left"
              width="100"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 4">{{
                  scope.row.achievementList[4].value
                }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="achievementList"
              v-if="todayachive[5]"
              :label="todayachive[5].name"
              width="100"
              align="left"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.achievementList.length > 5">{{
                  scope.row.achievementList[5].value
                }}</span>
              </template>
            </el-table-column>

            <el-table-column
              prop="isConfirm"
              align="left"
              width="100"
              label="状态"
            >
              <template slot-scope="scope">
                <span v-if="scope.row.isConfirm == 0" style="color: #00b98d"
                  >待确认</span
                >
                <span v-if="scope.row.isConfirm == 1" style="color: #999999"
                  >已确认</span
                >
              </template>
            </el-table-column>
            <el-table-column prop="id" align="left" label="操作" width="220">
              <template slot-scope="scope">
                <span v-if="scope.row.isConfirm == 0">
                  <el-button
                    type="primary"
                    v-if="item.deleteAndUpdate === 1"
                    size="mini"
                    plain="plain"
                    @click="dailyFill(2, scope.row)"
                    title="修改"
                    >修改</el-button
                  >
                  <el-button
                    type="danger"
                    v-if="item.deleteAndUpdate === 1"
                    size="mini"
                    plain="plain"
                    @click="handleDelete(scope.row)"
                    title="删除"
                    >删除</el-button
                  >
                  <!-- scope.row.isConfirm == 0 &&
                      (this.islead == 1 ||
                        item.isLeader == 0 ||
                        item.permission == 1) -->
                  <el-button
                    v-if="
                      scope.row.isConfirm == 0 &&
                      //&& islead == 1 && fid == gid
                      //item.isLeader == 0 &&
                      item.permission == 1
                    "
                    type="success"
                    size="mini"
                    plain="plain"
                    @click="handleEdit(scope.row)"
                    title="确认"
                    class="checkButton"
                    >确认</el-button
                  >
                </span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div style="display: flex"></div>
      </div>
    </div>
    <div class="taskList" v-if="dataList.length == 0">
      <p>--暂无数据--</p>
    </div>
    <!-- 日报弹框 -->
    <el-dialog
      :title="titleStation"
      :close-on-click-modal="false"
      :show-close="false"
      :visible.sync="dialogStation"
      class="postionbot"
      width="600px"
      center
    >
      <el-form
        status-icon
        ref="form"
        :model="form"
        label-width="120px"
        :rules="rules"
        class="demo-ruleForm"
      >
        <el-form-item label="任务日期 :" prop="taskDate" v-if="static == 0">
          <el-date-picker
            v-model="form.taskDate"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="任务日期 :" prop="taskDate" v-if="static == 2">
          <el-date-picker
            v-model="form.taskDate"
            :picker-options="pickerOptions"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>
        <!--明日计划的任务日期-->
        <el-form-item
          label="任务日期 :"
          prop="taskDates"
          v-if="static == 1 || static == 3"
        >
          <el-date-picker
            v-model="form.taskDates"
            @change="changeDate1"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="选择项目 :" prop="projectId">
          <el-select
            v-model="form.projectId"
            placeholder="请选择项目"
            clearable
            filterable
            @change="projectGroup"
          >
            <el-option
              v-for="item in projectList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
              placeholder="0"
            >
            </el-option>
          </el-select>
          <el-checkbox
            v-model="form.weekType"
            label="周末加班工时"
            size="large"
            :true-label="1"
            :false-label="0"
          />
        </el-form-item>
        <!-- <el-form-item label="本周计划 :" prop="weekPlan"
          v-if="(static == 1 && form.projectId) && personalWeekPlan != undefined">
          <el-card class="box-card" style="width: 70%">
            {{ personalWeekPlan }}
          </el-card>
        </el-form-item> -->
        <el-form-item
          label="周计划 :"
          prop="weekPlan"
          v-if="
            (static == 0 || static == 2) &&
            personalWeekPlan != undefined &&
            form.projectId
          "
        >
          <el-card class="box-card" style="width: 70%">
            {{ personalWeekPlan }}
          </el-card>
        </el-form-item>
        <el-form-item
          label="工时数 :"
          prop="time"
          v-if="static == 0 || static == 2"
        >
          <el-input
            v-model="form.time"
            placeholder="请输入工时数"
            style="width: 50%"
          ></el-input>
          <span>&nbsp;&nbsp;天&nbsp;&nbsp;(可精确到0.1天)</span>
        </el-form-item>
        <el-form-item label="工作内容 :" prop="content">
          <!--<el-input  placeholder="请输入工作内容" type="textarea" ></el-input>-->
          <el-input
            type="textarea"
            v-model="form.content"
            :autosize="{ minRows: 5, maxRows: 10 }"
            placeholder="请输入内容"
          >
          </el-input>
        </el-form-item>

        <!-- 工作业绩相关 -->
        <el-form-item
          v-for="items in form.achievement"
          :key="items.id"
          :label="items.name"
          :rules="[
            { required: true, message: '请输入' + items.name, trigger: 'blur' },
          ]"
          v-if="static == 0 || static == 2"
        >
          <el-input
            v-model.trim.number="items.value"
            placeholder="0"
            style="width: 50%"
          ></el-input>
          <span>&nbsp;&nbsp;个</span>
        </el-form-item>
      </el-form>
      <p style="text-align: center; color: red">
        温馨提醒：请开发人员记得及时更新项目开发进度。
      </p>

      <span slot="footer">
        <el-button @click="close('form')">取消</el-button>
        <el-button type="primary" @click="save('form')" :loading="loading"
          >确定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script>
import dailyDialog from "./dialog/dailyDialog";
import {
  getUserTaskList,
  selectFunctionGroupList,
  selectUserProject,
  selectGroupAttr,
  addTask,
  confirm,
  deleteTask,
  updateTask,
  unconfirmed,
  userProgressProjects,
  getPlanByType,
} from "@/service/Api.js";

export default {
  components: { dailyDialog },
  name: "dailyMent",
  data() {
    return {
      count: 0,
      // 查询条件
      groupsList: [],
      fid: "", //选择后的职能组id
      gid: "", //当前登录者的职能组id
      islead: "", //判断登陆者是否为组长
      nowleader: "",
      startDate: "", //项目开始日期
      tomoDate: "", //时间选择框双向绑定的时间  默认为明日
      keyword: "",
      dayFirst: "",
      pickerOptions: {
        //明日计划 和 修改任务 的时间选择器日期相关
        disabledDate(time) {
          return time.getTime() > Date.now() + 1000 * 60 * 60 * 24;
        },
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", date);
            },
          },
          {
            text: "一周前",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", date);
            },
          },
        ],
      },
      pickerOptions1: {
        //今日任务 的时间选择器日期相关
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", date);
            },
          },
          {
            text: "一周前",
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", date);
            },
          },
        ],
      },
      dataList: [],
      groupName: "",
      deleteAndUpdate: "",
      toloading: false,
      //添加日报
      isConfirm: "",
      permission: "",
      dialogStation: false,
      loading: false,
      titleStation: "",
      typeId: "",
      projectList: [],
      achievList: [], //业绩属性
      projectName: "",
      type: "", //任务类型 1-任务,2-计划
      static: "",
      taskDates: "", //明日时间
      todayachive: [], //今日任务业绩属性
      form: {
        createTime: "",
        taskDate: "",
        projectId: "",
        projectName: "",
        time: "",
        content: "",
        weekType: 0,
        achievement: [],
        id: "",
        taskDates: "", //明日日期
      },
      rules: {
        taskDate: [
          { required: true, message: "请选择任务日期", trigger: "blur" },
        ],
        taskDates: [
          { required: true, message: "请选择任务日期", trigger: "blur" },
        ],
        projectId: [{ required: true, message: "请选择项目", trigger: "blur" }],
        time: [
          { required: true, message: "请输入工时数", trigger: "blur" },
          {
            required: true,
            pattern: /^(?!(0[0-1]{0,}$))[0-1]{1,}[.]{0,}[0-9]{0,2}$/,
            message: "请输入合理的工时数",
            trigger: ["blur", "change"],
          },
        ],
        content: [
          { required: true, message: "请输入工作内容", trigger: "blur" },
        ],
      },
      id: "",
      personalWeekPlan: "",
    };
  },

  created() {
    let userInfo = sessionStorage.getItem("userInfo");
    let date = new Date();
    if (JSON.parse(userInfo).roleId == 11) {
      date.setTime(date.getTime() - 3600 * 1000 * 24);
      this.dayFirst = date.getDate();
    } else {
      this.dayFirst = date.getDate();
    }
    let year = date.getFullYear();
    let month = date.getMonth() + 1;
    let day = date.getDate();
    if (month < 10) {
      month = "0" + month;
    }
    if (this.dayFirst - 0 < 10) {
      this.dayFirst = "0" + this.dayFirst;
    }
    this.startDate = year + "-" + month + "-" + this.dayFirst;
    this.form.taskDate = year + "-" + month + "-" + this.dayFirst; //显示当天日期

    //显示第二天的日期
    this.taskDates = year + "-" + month + "-" + (this.dayFirst + 1);
    this.tomoDate = this.taskDates;
    this.groups(); //职能组查询
    this.projects(); //项目查询
  },
  mounted() {},
  methods: {
    getCount() {
      let userInfo = sessionStorage.getItem("userInfo");
      let i = JSON.parse(userInfo).fid;
      unconfirmed(i).then((res) => {
        if (res.code == 0) {
          this.count = res.data.sum;
        }
      });
    },
    // isConfirmFalg(row,column){
    //   return row.isConfirm==0?"待确认":"已确认";
    // },

    //表格背景颜色
    cellStyle(row, column, rowIndex, columnIndex) {
      return "background:#ecf9f7";
    },

    confimHours() {
      // this.$router.push("/confirm");
      let userInfo = sessionStorage.getItem("userInfo");
      let i = JSON.parse(userInfo).fid;
      this.$router.push({
        path: "/confirm",
        query: { fid: i },
      });
    },

    //添加-修改日报-明日计划
    dailyFill(type, row) {
      this.static = type;
      if (type == 0) {
        this.titleStation = "填写日报";
        this.type = 1;
        this.addll();
      } else if (type == 1) {
        this.titleStation = "明日计划";
        this.type = 2;
        this.addll();
      } else if (type == 2) {
        this.titleStation = "修改任务";
        this.type = 1;
        this.updatell(row);
      } else if (type == 3) {
        this.titleStation = "修改计划";
        this.type = 2;
        this.updatell(row);
      }
    },

    formatDate(date) {
      let y = date.getFullYear();
      let m = date.getMonth() + 1;
      m = m < 10 ? "0" + m : m;
      let d = date.getDate();
      d = d < 10 ? "0" + d : d;
      let h = date.getHours();
      let minute = date.getMinutes();
      minute = minute < 10 ? "0" + minute : minute;
      let second = date.getSeconds();
      second = minute < 10 ? "0" + second : second;
      return y + "-" + m + "-" + d;
    },

    addll() {
      this.attList();
      this.form.projectId = "";
      this.form.projectName = "";
      this.form.time = "";
      this.form.content = "";
      this.form.achievement = [];
      this.form.weekType = 0;
      this.dialogStation = true;

      //改变明日计划的时间
      let timre = this.startDate;
      this.form.taskDate = this.startDate;
      this.form.taskDates = this.formatDate(
        new Date(new Date(timre).setDate(new Date(timre).getDate() + 1))
      );
    },
    updatell(row) {
      this.form.createTime = row.createTime;
      this.form.taskDates = row.taskDate;
      this.form.taskDate = row.taskDate;
      this.form.id = row.id;
      this.form.achievement = [];
      this.form.projectId = row.projectId;
      this.form.projectName = row.projectName;
      this.form.time = row.time;
      this.form.content = row.content;
      this.form.weekType = row.weekType;
      this.dialogStation = true;
      if (row.achievementList) {
        //修改明日计划中没有 row.achievementList
        row.achievementList.forEach((element) => {
          this.form.achievement.push({
            name: element.name,
            value: element.value,
          });
        });
      }
      let data = {
        dateStr: this.form.taskDate,
        projectId: this.form.projectId,
      };
      getPlanByType(data, 2).then((res) => {
        if (res.code == 0) {
          this.personalWeekPlan = res.data.planStr;
        }
      });
    },
    //确认提交
    save(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          console.log(this.form.achievement);
          this.form.achievement.forEach((el) => {
            if (!el.value) {
              el.value = 0;
            }
          });
          let data = {
            id: this.form.id,
            taskDate:
              this.static == 0 || 2 ? this.form.taskDate : this.form.taskDate, //判断时间是今日还是明日
            projectId: this.form.projectId,
            projectName: this.form.projectName,
            time: this.form.time,
            achievement: JSON.stringify(this.form.achievement),
            type: this.type,
            content: this.form.content,
            weekType: this.form.weekType,
          };
          //判断状态  添加日报
          if (this.static == 0 || this.static == 1) {
            if (this.static == 1) {
              //判断是否为明日计划
              // data.taskDate=this.tomoDate
              data.taskDate = this.form.taskDates;
            }
            addTask(data).then((res) => {
              if (res === undefined) {
                this.$message.warning("您已添加过了!");
                return;
              }
              if (res.code == 0) {
                this.$message.success("操作成功!");
                this.close("form");
                this.dailyList();
              } else {
                this.$message.error(res.message);
              }
            });
          } else if (this.static == 2 || this.static == 3) {
            //判断状态  修改任务
            if (this.static == 3) {
              //判断是否为明日计划
              // data.taskDate=this.tomoDate
              data.taskDate = this.form.taskDates;
            } else if (this.static == 2) {
              data.taskDate = this.form.taskDate;
            }
            //
            updateTask(data).then((res) => {
              if (res.code == 0) {
                this.$message.success("操作成功!");
                this.close("form");
                this.dailyList();
              } else {
                this.$message.error(res.message);
              }
            });
          }
        } else {
          return false;
        }
      });
    },
    attList() {
      let data = {};
      let userInfo = sessionStorage.getItem("userInfo");
      this.gid = JSON.parse(userInfo).fid;
      selectGroupAttr(this.gid).then((res) => {
        //根据当前登陆者的职能组id查询职能属性
        if (res.code == 0) {
          this.achievList = res.data;
          this.achievList.forEach((element) => {
            this.form.achievement.push({
              name: element.name,
              value: "",
            });
          });
        } else {
          this.achievList = [];
        }
      });
      this.achievList = [];
    },
    //确认状态
    handleEdit(row) {
      this.$confirm("是否确认?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          confirm(row.id).then((res) => {
            if (res.code == 0) {
              this.dailyList();
              this.$message.success("操作成功!");
            }
          });
        })
        .catch(() => {
          //  this.$message.info("已取消!");
        });
    },
    //删除日报
    handleDelete(row) {
      this.$confirm("此操作将永久删除,是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        center: true,
      })
        .then(() => {
          deleteTask(row.id).then((res) => {
            if (res.code == 0) {
              this.$message.success("删除成功!");
              this.dailyList();
            } else {
              this.$message.warning(res.message);
            }
          });
        })
        .catch(() => {});
    },
    //项目下拉
    projectGroup(val) {
      if (!val) {
        return;
      }
      let pro = {};
      pro = this.projectList.find((item) => {
        return item.id === val;
      });
      this.form.projectName = pro.name;
      // if (this.static == 1 || this.static == 3) {
      let data = {
        dateStr: this.form.taskDates,
        projectId: val,
      };
      getPlanByType(data, 3).then((res) => {
        if (res.code == 0) {
          this.personalWeekPlan = res.data.planStr;
        }
      });
      // } else {
      //   let data = {
      //     dateStr: this.form.taskDate,
      //     projectId: val
      //   }
      //   getPlanByType(data, 2).then(res => {
      //     if (res.code == 0) {
      //       this.personalWeekPlan = res.data.planStr
      //     }
      //   })
      // }
    },
    //关闭弹框
    close(formName) {
      this.$refs[formName] && this.$refs[formName].resetFields();
      this.dialogStation = false;
      this.tomoDate = this.taskDates;
    },
    projects() {
      userProgressProjects().then((res) => {
        if (res.code == 0) {
          this.projectList = res.data;
          if (res.data > 0) {
            this.projectId = res.data[0].id;
            this.projectName = res.data[0].name;
          } else {
            this.projectId = "";
          }
        }
      });
    },
    changeDate(val) {
      this.startDate = val;
      // this.dailyList();
      this.groups();
    },
    changeDate1(val) {
      this.tomoDate = val;
      this.dailyList();
    },
    changeGroup(val) {
      console.log("职能组id", val);
      let obj = {};
      obj = this.groupsList.find((item) => {
        return item.id === val;
      });
      this.getTodayachive();
      this.dailyList();
      this.getCount();
    },
    // 获取今日任务中的业绩属性
    getTodayachive() {
      selectGroupAttr(this.fid).then((res) => {
        //根据当前登陆者的职能组id查询职能属性
        if (res.code == 0) {
          this.todayachive = res.data;
        } else {
          this.todayachive = [];
        }
      });
      this.todayachive = [];
    },
    groups() {
      let userInfo = sessionStorage.getItem("userInfo");
      let id = JSON.parse(userInfo).id;
      selectFunctionGroupList(id).then((res) => {
        if (res.code == 0) {
          this.groupsList = res.data;
          let f;
          let arr = [];
          res.data.forEach((item) => {
            arr.push(item.id);
            f = arr.join(",");
          });
          let list = [
            {
              id: f,
              name: "所有职能组",
            },
          ];
          list.push(...res.data);
          this.groupsList = list;
          if (res.data.length > 0) {
            let userInfo = sessionStorage.getItem("userInfo");
            if (JSON.parse(userInfo).fid == 0) {
              this.fid = f;
            } else {
              this.fid = JSON.parse(userInfo).fid;
            }
            this.islead = JSON.parse(userInfo).isLeader;
            if (this.islead == 1) {
              this.getCount();
            }
            this.attList();
            this.getTodayachive();
          } else {
            // this.item.name = "请选择";
          }
          this.dailyList(); //日报列表
        }
      });
    },
    gotoPerProject(item) {
      this.$router.push({ path: "/weekly", query: { id: item.userId } });
    },
    //日报列表查询
    dailyList() {
      this.toloading = true;
      let data = {
        fids: this.fid,
        startDate: this.startDate,
        keyword: this.keyword,
      };
      getUserTaskList(data).then((res) => {
        this.toloading = false;
        if (res.code == 0) {
          this.dataList = res.data;
        } else {
          this.dataList = [];
        }
      });
    },
    //查看历史计划
    dataliClick(id, typeId, startDate, groupName, name) {
      this.$store.commit("SET_TYPE_ID", typeId);
      this.$router.push({
        path: "/dailyDialog",
        query: {
          id: id,
          typeId: typeId,
          startDate: startDate,
          groupName: groupName,
          name: name,
        },
      });
    },
  },
};
</script>

<style scoped>
#dailyMent {
  height: 100%;
}

.dailyTop {
  display: flex;
  justify-content: space-between;
  padding: 20px 20px 0 20px;
}

.taskList p {
  color: #999;
  font-size: 16px;
  text-align: center;
}

.taskTile {
  width: 98%;
  display: flex;
  align-items: center;
  margin: 10px 20px 0 20px;
  padding: 0 10px;
  border: 1px solid #e8eef5;
  background: #f9f9f9;
  border-bottom: 0px;
  height: 39px;
  justify-content: space-between;
}

.class_taskTile_left {
  display: flex;
  align-content: center;
  justify-content: flex-start;
}

.taskTile i {
  font-size: 22px;
  color: #34b79a;
}

.taskTile h3,
.taskTile span {
  margin-right: 20px !important;
}

.tody {
  width: 25%;
}

.fulfill {
  width: 100%;
}

.tomorrow {
  width: 55%;
}

.web {
  width: 98%;
  margin-top: 0;
}

.web h3 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  border-top: 1px solid #e8eef5;
  border-left: 1px solid #e8eef5;
  padding: 10px 5px;
  background: #f9f9f9;
  height: 39px;
}

.web h3 span:first-child {
  width: 100%;
  display: flex;
  justify-content: center;
  flex: 1;
}

.web h3 span:last-child {
  color: #999;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.web h3 span:last-child:hover {
  color: red;
}

.el-table--border {
  height: calc(100% - 42px);
}

.el-table__body-wrapper {
  height: inherit;
}

.el-table__row {
  min-height: 57px !important;
}

.checkButton {
  margin-top: 3px;
}

.dailyplan {
  color: #e6a23c;
}

.el-badge {
  margin-left: 10px;
}

/* #menu{
    position: fixed;
  }
  .taskList .el-button{
    margin: 5%;
  } */

.el-button--mini {
  padding: 2px 15px;
}
</style>
